﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Epam.PhotoGallery.Interfaces.DataTransferObjects.BookDetails>" MasterPageFile="~/Views/Shared/ViewMasterPage.Master" %>
<%@ Import Namespace="Epam.PhotoGallery.Site.Models" %>
<asp:Content ID="TitleContent" ContentPlaceHolderID="htmlHeader" runat="server">
   <link rel="stylesheet" type="text/css" href="<%= Url.Content("~/Content/css/bookDetails.css") %>" />

   <%
       Html.Styles().Add("Content/css/bookDetails.css");

       Html.Scripts().Add("Scripts/jquery-1.4.1.js");
       Html.Scripts().Add("http://books.google.com/books/previewlib.js");
       Html.Scripts().Add("Scripts/bookDetailsInit.js");
       
   %>
    
    <title>BookDetails</title>

    </asp:Content>

<asp:Content ID="mainContent" ContentPlaceHolderID="MainContent" runat="server">
    
    <div id="main">

        <img id="mainBookImage" src="<%=Model.ImagePath %>" title="See at Amazon.com" />
        <h2 ><%=Model.Title %></h2>
        <div class="bookDetails">
            Authors:
            <% for (int index = 0; index < Model.Authors.Count; index++)
               { %> 
             <% = Model.Authors[index]%>
                  <% if (index < Model.Authors.Count - 1)
                   {
                %>
                ,
                <%} %>
            <%} %>

        </div>
        <div id="numberOfPages" class="bookDetails">Pages: <%=Model.NumberOfPages%></div>
        <div id="publisher" class="bookDetails">Publisher: <%=string.Format("{0}, {1} Edition {2:yyyy-MM-dd}",Model.Publisher,Model.Edition,Model.ReleaseDate) %></div>
        <div class="bookDetails">ISBN: <span id="isbn"><%=Model.ISBN %></span></div>
        <div class="bookDetails">EAN: <span id="ean"><%=Model.EAN %></span></div>
        <div id="viewer" class="bookDetails">
        <script type="text/javascript" language="javascript">
            GBS_setLanguage("en");
            var isbn = $('#isbn').text();
            GBS_insertPreviewButtonPopup('ISBN:' + isbn);
        </script>
        </div>

        <div id="bookDescription">
        <h2>Book description</h2>
         <%= Model.EditorialReview %>
        </div>
    </div>
</asp:Content>
